package com.ruoyi.ring.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ring.mapper.RingSleepInfoMapper;
import com.ruoyi.ring.domain.RingSleepInfo;
import com.ruoyi.ring.service.IRingSleepInfoService;

/**
 * 睡觉信息Service业务层处理
 * 
 * @author liuwp
 * @date 2025-08-18
 */
@Service
public class RingSleepInfoServiceImpl implements IRingSleepInfoService 
{
    @Autowired
    private RingSleepInfoMapper ringSleepInfoMapper;

    /**
     * 查询睡觉信息
     * 
     * @param id 睡觉信息主键
     * @return 睡觉信息
     */
    @Override
    public RingSleepInfo selectRingSleepInfoById(Long id)
    {
        return ringSleepInfoMapper.selectRingSleepInfoById(id);
    }

    /**
     * 查询睡觉信息列表
     * 
     * @param ringSleepInfo 睡觉信息
     * @return 睡觉信息
     */
    @Override
    public List<RingSleepInfo> selectRingSleepInfoList(RingSleepInfo ringSleepInfo)
    {
        return ringSleepInfoMapper.selectRingSleepInfoList(ringSleepInfo);
    }

    /**
     * 根据业务主键查询一条记录：睡觉信息
     *
     * @param ringSleepInfo 睡觉信息
     * @return 睡觉信息
     */
    @Override
    public RingSleepInfo selectOneRingSleepInfo(RingSleepInfo ringSleepInfo)
    {
        return ringSleepInfoMapper.selectOneRingSleepInfo(ringSleepInfo);
    }

    /**
     * 新增睡觉信息
     * 
     * @param ringSleepInfo 睡觉信息
     * @return 结果
     */
    @Override
    public int insertRingSleepInfo(RingSleepInfo ringSleepInfo)
    {
        ringSleepInfo.setCreateTime(DateUtils.getNowDate());
        return ringSleepInfoMapper.insertRingSleepInfo(ringSleepInfo);
    }

    /**
     * 修改睡觉信息
     * 
     * @param ringSleepInfo 睡觉信息
     * @return 结果
     */
    @Override
    public int updateRingSleepInfo(RingSleepInfo ringSleepInfo)
    {
        return ringSleepInfoMapper.updateRingSleepInfo(ringSleepInfo);
    }

    @Override
    public int updateRingSleepInfoCondition(RingSleepInfo ringSleepInfo, RingSleepInfo ringSleepInfoCondition)
    {
        return ringSleepInfoMapper.updateRingSleepInfoCondition(ringSleepInfo, ringSleepInfoCondition);
    }

    /**
     * 批量删除睡觉信息
     * 
     * @param ids 需要删除的睡觉信息主键
     * @return 结果
     */
    @Override
    public int deleteRingSleepInfoByIds(Long[] ids)
    {
        return ringSleepInfoMapper.deleteRingSleepInfoByIds(ids);
    }

    /**
     * 删除睡觉信息信息
     * 
     * @param id 睡觉信息主键
     * @return 结果
     */
    @Override
    public int deleteRingSleepInfoById(Long id)
    {
        return ringSleepInfoMapper.deleteRingSleepInfoById(id);
    }

    /**
     * 条件删除睡觉信息
     *
     * @param ringSleepInfo 睡觉信息
     * @return 结果
     */
    @Override
    public int deleteRingSleepInfoByCondition(RingSleepInfo ringSleepInfo)
    {
        return ringSleepInfoMapper.deleteRingSleepInfoByCondition(ringSleepInfo);
    }

}
